﻿@using Microsoft.AspNet.Identity
<nav class="navbar navbar-default" role="navigation">
    <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            @Html.ActionLink("NBSP", "Index", "Home", null, new { @class = "navbar-brand" })
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse navbar-ex1-collapse">
            <ul class="nav navbar-nav">
                <li>@Html.ActionLink("Home", "Home", "Home")</li>
                <li>@Html.ActionLink("About", "About", "Home")</li>
                <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
            </ul>
        <!--<form class="navbar-form navbar-left" role="search">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="Search">
                </div>
                <button type="submit" class="btn btn-default">Submit</button>
            </form>-->
            
                @if (Request.IsAuthenticated)
                {
                    using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
                    {
                        @Html.AntiForgeryToken()
    <ul class="nav navbar-nav navbar-right">
        <li><a href="#">Link</a></li>

        <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                <img class="img-circle" src="https://lh5.googleusercontent.com/-b0-k99FZlyE/AAAAAAAAAAI/AAAAAAAAAAA/eu7opA4byxI/photo.jpg?sz=120">
                @User.Identity.GetUserName() <b class="caret"></b>
            </a>
            <ul class="dropdown-menu">
                <li>
                    @Html.ActionLink("Profil", "Details", "StudentRegistration", routeValues: new { id = User.Identity.GetUserName() }, htmlAttributes: new { title = "Manage" })
                </li>
                <li><a href="javascript:document.getElementById('logoutForm').submit()">Izloguj se</a></li>
            </ul>
        </li>
    </ul>
                    }
                }
                else
                {
                    <ul class="nav navbar-nav navbar-right">
                        <li>@Html.ActionLink("Registracija", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
                        <li>@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
                    </ul>
                }
            
        </div><!-- /.navbar-collapse -->
    </div>
</nav>

